<!DOCTYPE html>
<html lang="en">
<head>
    <title>未关闭事项管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/dist/plugins/select2/select2.min.css">
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=86e2297f">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=222aea35">
</head>
<body>
<section class="content" id="app">
    <div style="width: 19%; float: left;">
        <div class="box-body no-padding" style="overflow: auto;background: #f7f8fa;">
            <ul class="ztree" id="ulGroupCompanyDepartRole">
                <li style="list-style: none; height: 30px;line-height: 30px;" v-for="(item,i) in companyList">
                    {{item.NAME}}({{item.UnFinishCount}})
                </li>
            </ul>
        </div>
    </div>
    <div style="width: 80%; float: right">
        <div class="box-body no-padding box-border" style="overflow: auto;background: #fff;">
            <div class="box-header with-border" style="background: #f7f8fa;">
                <input type="button" value="添加未关闭事项" id="addUserBtn" class="btn oaBtn btn-sm pull-right"/>
            </div>
            <div class="box-body no-padding iframeH2" style="overflow: auto;">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th width="40%">未关闭事项</th>
                        <th>日期</th>
                        <th>提出人</th>
                        <th>本公司<br/>跟踪人</th>
                        <th>总公司<br/>跟踪人</th>
                        <th>预计关闭日期</th>
                        <th>状态</th>
                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody id="tbList">
                    <template v-for="(item,i) in list">
                        <tr>
                            <td>{{i+1}}</td>
                            <td>{{item.TRACK_CONTENT}}</td>
                            <td>{{item.CREATE_TIME}}</td>
                            <td>{{item.USER_ID}}</td>
                            <td>{{item.TRACK_THECOMPANY}}</td>
                            <td>{{item.TRACK_HEADCOMPANY}}</td>
                            <td>{{item.OVER_TIME}}</td>
                            <td>{{item.JOB_STATE}}</td>
                            <td>
                                <a class="more-track" @click="moreTrack(i,item)" v-if="item.btnOp==0">更多跟踪</a>
                                <a class="more-track" @click="closeTrack(i,item)" v-if="item.btnOp==1">关闭跟踪</a>
                                &nbsp;&nbsp;<a href="#">关闭</a>
                            </td>
                        </tr>
                        <tr  v-if="item.btnOp==0">
                            <td>&nbsp;</td>
                            <td colspan="7">{{item.JINZHAN}}</td>
                            <td><a href="#">回复</a></td>
                        </tr>
                        <tr v-for="(item1,j) in item.trackList"  v-if="item.btnOp==1">
                            <td>&nbsp;</td>
                            <td colspan="7">{{item1.jinzhan}}</td>
                            <td><a href="#">回复</a></td>
                        </tr>
                    </template>

                    </tbody>
                </table>
            </div>
            <div class="oa-pager text-center">
                共<span id="allCount">{{recordCount}}</span>条记录&nbsp;&nbsp;&nbsp;
                <span id="nowPage">{{pageIndex}}</span>/<span id="allPage">{{pageCount}}</span>&nbsp;&nbsp;&nbsp;
                <span id="first" class="oa-pager-button" @click="pagination('first')">首页</span>
                <span id="prev" class="oa-pager-button" @click="pagination('pre')">上一页</span>
                <span id="next" class="oa-pager-button" @click="pagination('next')">下一页</span>
                <span id="last" class="oa-pager-button" @click="pagination('last')">尾页</span>
            </div>
        </div>
    </div>


</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript" src="/dist/plugins/select2/select2.full.min.js"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            currentUser: getCurrentUser(),
            pageIndex: 1,
            pageCount: 1,
            recordCount: 1,
            list: [],
            companyList: []
        },
        methods: {
            refresh: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.wreport.wreportUnfinish.getWReportUnfinishMainList, {
                    pageIndex: that.pageIndex
                }, function (data) {
                    for (var i = 0; i < data.records.length; i++) {
//                        data.records[i].trackList = [];
//                        var o = new Object();
//                        o.jinzhan = data.records[i].JINZHAN;
//                        data.records[i].trackList.push(o);
                        data.records[i].btnOp=0;
                    }
                    that.list = data.records;
                });
            },
            pagination: function (auction) {
                if (auction == "first")
                    this.pageIndex = 1;
                else if (auction == "next" && this.pageIndex < this.pageCount)
                    this.pageIndex += 1;
                else if (auction == "pre" && this.pageIndex > 1)
                    this.pageIndex -= 1;
                else if (auction == "last")
                    this.pageIndex = this.pageCount;
                this.refresh();
            },
            add: function (id, pageType) {
                $.dialog({
                    content: 'url:detail.html?id=' + id + '&pageType=' + pageType + "&t=" + new Date(),
                    title: '添加未关闭事项',
                    width: 500,
                    height: 500,
                    max: false,
                    min: false,
                    lock: true
                });
            },
            moreTrack: function (i, item) {
                var that = this;
                item.trackList = [];
                item.btnOp=1;
                for (var i = 0; i < 3; i++) {
                    var test = new Object();
                    test.jinzhan = "点击跟踪aaaaa" + (i + 1);
                    item.trackList.push(test);
                }

            },
            closeTrack:function (i,item) {
                item.btnOp=0;
            }
        },

        mounted: function () {
            var that = this;
            this.refresh();
            $.wyui.postMethod(urlConfig.wreport.wreportUnfinish.getWReportUnfinishCount, {}, function (data) {
                that.companyList = data;
            });

        }
    });
</script>


</body>
</html>